package com.funcablaze.component.view;

import com.funcablaze.component.control.Graphic;
import com.funcablaze.component.control.Theme;
import com.funcablaze.func.Color;
import com.funcablaze.window.Frame;

public class TextView extends View {
	protected String text = "";
	protected Color textColor = new Color(0, 0, 0, 255);
	protected String FontFamily = "Arial";
	protected int FontSize = 15;
	
	public TextView() {
	
	}
	
	@Override
	public void _draw(Graphic graphic, Theme.ThemeType theme) {
		super._draw(graphic, theme);
		graphic.setColor(textColor);
	}
	
	/**
	 * 设置文本
	 * @param text 文本
	 */
	public void setText(String text) {
		this.text = text;
	}
	
	/**
	 * 设置文本颜色
	 * @param hex 十六进制颜色值
	 */
	public void setTextColor(String hex) {
		this.textColor = new Color(hex);
	}
	
	/**
	 * 设置字体
	 * @param fontFamily 字体
	 */
	public void setFontFamily(String fontFamily) {
		this.FontFamily = fontFamily;
	}
	
	/**
	 * 设置字体大小
	 * @param fontSize 字体大小
	 */
	public void setFontSize(int fontSize) {
		this.FontSize = fontSize;
	}
}
